{#**
*
* 功能描述（列表模板）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*#}
{#include file="header.tpl" title="title" active="order" #}
{#include file="define.tpl" scope=parent#}
<div class="content middle">
    <div class="ui breadcrumb">
        <a class="section" href="index.php">主页</a>
        <i class="right"></i>
        <span class="active section">订单管理</span>
    </div>
    <div style="overflow: hidden;">
    {#include file="search_bar.tpl" s_basic = ['type'=>[0, '订单类型', $g_ordertype], 'status'=>[0, '状态', $o_sta]] s_vdate=['c_start'=>'最早下单', 'c_end'=>'最晚下单', 'br'=>'', 'd_start'=>'最早送货', 'd_end'=>'最晚送货'] s_keys=['id'=>'订单号后缀', 'consignee'=>'收货人', 'mobile_to'=>'收货电话', 'mobile_from'=>'订货电话']#}
</div>
    <div class="button_bar">
        <a class="button align_right" href="index.php?action=order.commit">添加订单</a>
    </div>
    <table class="ui table segment">
        <thead>
            <tr>
                <th>序号</th>
                <th>订单号</th>
                <th>类型</th>
                <th>订货账号</th>
                <th>订货电话</th>
                <th>收货人</th>
                <th>收货电话</th>
                <th style="width: 105px;">送货时间</th>
                <th style="width: 105px;">下单时间</th>
                <th style="width: 70px;">确认状态</th>
                <th style="width: 70px;">收款状态</th>
                <th style="width: 78px;">状态</th>
            </tr>
        </thead>
        <tbody>
            {#foreach $listdata as $item#}
                <tr>
                    <td>{#$item['id']#}</td>
                    <td><a href="index.php?action=order.detail&id={#$item['id']#}">{#$item['id']+$orderid_base#}</a></td>
                    <td>{#$g_ordertype[$item['type']]#}{#if $item['add_adm'] != 0#}<a href="#" onclick="return showadm({#$item['add_adm']#})">(电话订单)</a>{#/if#}</td>
                    <td><a href="#" onclick="return showuser({#$item['userid']#})">ID {#$item['userid']#}</a></td>
                    <td>{#$item['mobile_from']#}</td>
                    <td>{#$item['consignee']#}</td>
                    <td>{#$item['mobile_to']#}</td>
                    <td>{#$item['delivery_time']#}</td>
                    <td>{#$item['createtime']#}</td>
                    <td>
                        {#if $item['cofm_adm'] == 0#}
							{#if $item['status'] == 1#}
                            <a title='点此确认订单' href="index.php?action=order.setSpStatus&type=1&id={#$item['id']#}&status=1" onclick="ajax_this(this, '一但确认不可取消'); return false">未确认</a>
							{#else#}
								未确认
							{#/if#}
                        {#else#}
                            <a href="#" title='点击查看确认管理员信息' onclick="return showadm({#$item['cofm_adm']#})">ID{#$item['cofm_adm']#}确认</a><br/>
                        {#/if#}
                    </td>
                    <td id='pay_{#$item['id']#}'>
                        {#if $item['pay_adm'] == 0#}
							{#if $item['status'] == 1#}
                            <a title='点击付款' href="javascript:void(0)" onclick="openWindow(null, 'index.php?action=order.payui&id={#$item['id']#}', 400, 300, '订单付款')">未付款</a>
							{#else#}
								未付款
							{#/if#}
                        {#else#}
                            <a title='点击查看收款管理员信息' href="#" onclick="return showadm({#$item['pay_adm']#})">ID {#$item['pay_adm']#}</a><br/>
							{#if $item['status'] == 1#}
                            (<a href="index.php?action=order.setSpStatus&type=2&id={#$item['id']#}&status=0" onclick="ajax_this(this, '取消之后原付款记录有效,仅适用于追加款项, 确认订单金额已是追加金额?');return false">取消</a>)
							{#/if#}
                        {#/if#}
                    </td>
                    <td>
						{#if $item['status'] == 1#}
						进行中<br/>
						{#if $item['pay_adm'] != 0#}
						<a title='完成订单，产生积分和销量' href='index.php?action=order.setstatus&id={#$item['id']#}&status=2' onclick='order_setsta(this, "确认", 0); return false'>完成</a>
						{#/if#}
						<a title='取消订单，付款之后可完成' href='index.php?action=order.setstatus&id={#$item['id']#}&status=3' onclick='order_setsta(this, "取消", 0); return false'>取消</a>
						{#else#}
							{#$o_sta[$item['status']]#}
						{#/if#}
                    </td>
                </tr>
            {#/foreach#}
        </tbody>
        <tfoot>
            <tr>
                <th colspan="14" style="font-style: normal;">
                    {#include file="paging_bar.tpl"#}
                </th>
            </tr>
        </tfoot>
    </table>
</div>
{#include file="footer.tpl" #}

